<?php
$from = strip_tags($_POST['from']);
$name = strip_tags($_POST['name']);
$to = strip_tags($_POST['to']);
$subject = strip_tags($_POST['subject']);
$message = strip_tags($_POST['message']);
$path = $_POST['path'];

mail($to, $subject, $message, 'From: ' . $from);
header("Location: $path")
?>